package com.ys.erp.entity.data.bean;

import com.baomidou.mybatisplus.annotation.*;
import jakarta.validation.constraints.Pattern;
import lombok.Data;

import java.time.LocalDate;
import java.time.LocalDateTime;

/**
 * @author lwj
 * @date 2023/10/27
 */

@Data
@TableName(value = "t_user_cat_record")
public class UserCatRecord {
    /**
     * 主键
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    /**
     * 用户id
     */
    @TableField(value = "user_id")
    private Long userId;

    /**
     * 猫咪编号
     */
    @TableField(value = "cat_code")
    private String catCode;

    /**
     * 事件描述
     */
    @TableField(value = "record_describe")
    private String recordDescribe;

    /**
     * 记录时间
     */
    @TableField(value = "record_time")
    private LocalDateTime recordTime;

    /**
     * 员工id
     */
    @TableField(value = "emp_id")
    private Long empId;

    /**
     * 员工名字
     */
    @TableField(value = "emp_name")
    private String empName;

    @TableField(value = "is_have_in_money")
    private Integer isHaveInMoney;

    @TableField(value = "in_money_date")
    private LocalDate inMoneyDate;

    @TableField(value = "in_money_detail")
    private String inMoneyDetail;

    @TableField(value = "in_money_total")
    private Long inMoneyTotal;

    @TableField(value = "refund_and_break_type")
    private Integer refundAndBreakType;

    @TableField(value = "refund_money")
    private Long refundMoney;

    @TableField(value = "version")
    @Version
    private Integer version;

    @TableField(value = "create_time")
    private LocalDateTime createTime;

    @TableField(value = "update_time")
    private LocalDateTime updateTime;


    @Data
    public static class CatRecordDetailDTO {

        private String inCate;

        @Pattern(regexp = "^[0-9]+(.[0-9]{1,2})?$", message = "金额格式错误")
        private String money;

        private String inMethod;

    }


}